package com.example.retrofitinterface;

import com.example.bean.DataBean;
import com.example.okhttp.CallBackImpl;
import com.okhttp.annotations.ApiGenerateService;
import com.okhttp.annotations.ApiResponseHandler;
import com.okhttp.cache.CacheControl;
import com.okhttp.retrofit.BaseResponseBodyHandler;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * @author GYL
 * @dateTime 2020/4/24-14:50
 * @description
 */
@ApiGenerateService(BaseResponseBodyHandler.class)
public interface Net3 {

  @ApiResponseHandler(
      genericity = DataBean.class
  )
  @Headers(CacheControl.CACHE_HEADER)
  @FormUrlEncoded
  @POST("city")
  public Call<ResponseBody> doGet1(@Field("postTest") String test);
  
  @Headers(CacheControl.CACHE_HEADER)
  @FormUrlEncoded
  @POST("city")
  public Call<ResponseBody> doGet2(@Field("postTest") String test);
  
  @ApiResponseHandler(
    handler = CallBackImpl.class
  )
  @Headers(CacheControl.CACHE_HEADER)
  @FormUrlEncoded
  @POST("city")
  public Call<DataBean> doGet3(@Field("postTest") String test);
  
  
  @ApiResponseHandler(
    handler =CallBackImpl.class
  )
  @Headers(CacheControl.CACHE_HEADER)
  @FormUrlEncoded
  @POST("city")
  public Call<DataBean> doGet4(@Field("postTest") String test);
  
}
